package com.jml.并行计算;


import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author:jml
 * @date: 2019/6/20 0020 22:30
 * @description：(B+C)*B/2
 */
public class Multiply implements Runnable {

    public static BlockingQueue<Msg> bq = new LinkedBlockingQueue<Msg>();

    @Override
    public void run() {
        while (true) {
            try {
                Msg msg = bq.take();
                msg.i = msg.i * msg.j;  // i*(i+j)
                Div.bq.add(msg);
            } catch (InterruptedException e) {
            }
        }
    }
}
